<!-- create begin -->
<div class="print">


    <!-- 表单 -->   
    <section class="panel-body" >
        <form role="form" class="form-edit">

            <div class="form-group col-sm-12">
                <span>编号</span>
                <input type="text" class="form-control" placeholder="编号" name="sn" v-model="param.sn" disabled="disabled">
            </div>

            <div class="form-group col-sm-6">
                <span>销售人</span>
                <input type="text" class="form-control" placeholder="销售人" name="author" v-model="param.author" disabled="disabled">
            </div>

            <div class="form-group col-sm-6">
                <span>客户</span>
                <select name="customer" class="form-control comboSelect customer" v-model="param.customer" disabled="disabled">
                    {volist name="customer" id="vo"}
                        <option value="{$vo.id}" >{$vo.title}</option>
                    {/volist}
                </select>
            </div>

            <div class="form-group col-sm-6">
                <span>销售渠道</span>
                <select name="channel" class="form-control comboSelect" v-model="param.channel" disabled="disabled">
                    <option value="默认">默认</option>
                    <option :value="item" v-for="item in channel" v-text="item"></option>
                </select>
            </div>

            <div class="form-group col-sm-6">
                <span>销售日期</span>
                <input type="text" class="form-control" placeholder="销售日期" name="date" v-model="param.sale_date" id="sale_date" disabled="disabled">
            </div>

            {include file="common/print-table" /}

            <div class="form-group col-sm-12 no-print">
                <button type="button" class="btn btn-sm btn btn-primary" @click="print"> 打 印 </button>
            </div>

        </form>
    </section>

</div>
<!-- create end-->


<script src="/static/admin/js/jQuery.print.min.js"></script>
<script>
 var list = {:json_encode($row->lists) };
 var layer_index = 0;

// seajs
seajs.use(['vendor/comboSelect/jquery.combo.select','vendor/channel','vendor/laydate/laydate'], function() {

    var data = {
        name: '名称',
        model: '型号',
        spec: '规格',
        color: '颜色',
        num: '数量',
        unit: '单位',
        price: '单价',
        count: '合计',
    };

    // vue
    var edit = new Vue({
        el: '.print',
        data: {
            data: data,
            list: list,
            channel:channel,
            count: parseFloat('{$row.count}'),
            param:{
                id:"{$row.id}",
                sn:"{$row.sn}",
                author:"{$row.author}",
                channel: "{$row.channel}",
                sale_date: "{$row.sale_date}",
                customer: "{$row.customer}",
                count: this.count,
                data: this.list,
                dels:[]
            }
        },
        mounted: function (){
        },
        methods: {
            print: function () {
                $(".print").print({
                    globalStyles : true,
                    addGlobalStyles : true,
                    stylesheet : null,
                    rejectWindow : true,
                    noPrintSelector : ".no-print",
                    iframe : true,
                    append : null,
                    prepend : null
                });
            }


        },


    });
    

});

</script>